﻿using Clover.BaseAuth;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Clover.Demo
{
    public class FileCurrentPermission : DefaultCurrentPermission
    {
        internal static Dictionary<string, Enum[]> Current = new Dictionary<string, Enum[]>();

        public override Enum[] ReadPermissions(string Identity)
        {
            return Current.ContainsKey(Identity)? Current[Identity] as Enum[] : Enumerable.Empty<Enum>().ToArray();
        }

        public override void SavePermissions(string Identity, Enum[] Permissions)
        {
            Current.Add(Identity, Permissions);
        }
    }
}